/**
 * Ingenius-Group S.A.S
 *
 * Project: SAU
 * File: EditDocumentEvent.java
 * Date: 07/02/2011
 */

package com.ingenius.sau.client.event;

import com.google.gwt.event.shared.EventHandler;
import com.google.gwt.event.shared.GwtEvent;
import com.ingenius.sau.client.event.EditDocumentEvent.EditDocumentEventHandler;

/**
 * Class <strong>EditDocumentEvent</strong>
 * 
 * @author Jesus David
 * @version 0.1
 */
public class EditDocumentEvent extends GwtEvent<EditDocumentEventHandler> {

	public interface EditDocumentEventHandler extends EventHandler {

		void onEditDocument(EditDocumentEvent event);
	}

	public static Type<EditDocumentEventHandler> TYPE = new Type<EditDocumentEventHandler>();

	private final String documentId;

	public EditDocumentEvent(String documentId) {
		this.documentId = documentId;
	}

	public String getDocumentId() {
		return documentId;
	}

	@Override
	public Type<EditDocumentEventHandler> getAssociatedType() {
		return TYPE;
	}

	@Override
	protected void dispatch(EditDocumentEventHandler handler) {
		handler.onEditDocument(this);
	}

}
